/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package command;

import presenter.CadPacientePresenter;

/**
 *
 * @author KDC
 */
public class SalvarEditarCommand extends AbstractCommandCad {

    public SalvarEditarCommand(CadPacientePresenter cadPac) {
        super(cadPac);
    }

    @Override
    public void executar() {

        if (verificar()) {
            if (cadPaciente.getPaciente() != null) {
                if (cadPaciente.getCp().existePacienteCadastrado(cadPaciente.getPaciente().getNome())) {
                    cadPaciente.getCp().ExcluirPaciente(cadPaciente.getPaciente().getNome());
                    cadastrar();
                }
            }
        }

    }

}
